import instance from "./axiosConfig"

interface ResponseType {
    code: number;
    message: string;
    data: any;
    token?: string;
}


export const httpGet = (url: string, data?: object): Promise<ResponseType> => {
    return instance.get(url, {
        params: data
    })
}
export const httpPost = (url: string, data?: object): Promise<ResponseType> => {
    return instance.post(url, data)
}
export const httpPut = (url: string, data?: object): Promise<ResponseType> => {
    return instance.put(url, data)
}
export const httpDelete = (url: string, data?: object): Promise<ResponseType> => {
    return instance.delete(url, {
        params: data
    })
}
